|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfurny.furndb.importer.FurnDBImporter
public class FurnDBImporter
This class imports furnitures from the OgreXML format. The importer needs a JME application during import to render thumbnail images. There are two ways that depend on the constructor being used: create a new application or use an existing one.
| Nested Class Summary | |
|---|---|
static class |
FurnDBImporter.ExitMode
The exit mode describes what the importer should do after an import. |
static interface |
FurnDBImporter.ImportListener
Interface to observe import state. |
| Field Summary | |
|---|---|
private Furniture |
actFurn
|
private com.jme3.app.SimpleApplication |
app
|
private FurnDBImporter.ExitMode |
exitMode
|
private java.lang.String |
lastAssetPath
|
private FurnDBImporter.ImportListener |
listener
|
private static java.util.logging.Logger |
LOGGER
|
private IModelSource |
modelSource
|
private RenderThumbnailState |
rtt
|
| Constructor Summary | |
|---|---|
FurnDBImporter()
Constructor that creates a new JME application. |
|
FurnDBImporter(com.jme3.app.SimpleApplication app)
Constructor that uses an existing JME application. |
|
| Method Summary | |
|---|---|
private void |
checkForExit()
Checks for the action to perform depending on the exit mode. |
void |
importModelsFromFiles(java.lang.String assetPath,
java.util.List<java.io.File> files,
FurnDBImporter.ImportListener listener)
Imports models from a list of files. |
void |
importModelsFromPath(java.lang.String assetPath)
Imports models from a file path. |
static void |
main(java.lang.String[] args)
A main class to test behavior. |
void |
renderingCompleted(java.lang.String id,
java.awt.image.BufferedImage image)
This listener methods is called when the rendering of the id is complete. |
private void |
renderThumbNail(Furniture f)
Renders a thumbnail for the given furniture. |
void |
savingCompleted(java.lang.String id,
java.io.File file)
This listener method is called when the rendered image has been saved to a file. |
void |
setExitMode(FurnDBImporter.ExitMode exitMode)
Sets the FurnDBImporter.ExitMode for this importer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger LOGGER
private IModelSource modelSource
private final RenderThumbnailState rtt
private Furniture actFurn
private FurnDBImporter.ExitMode exitMode
private final com.jme3.app.SimpleApplication app
private FurnDBImporter.ImportListener listener
private java.lang.String lastAssetPath
| Constructor Detail |
|---|
public FurnDBImporter()
public FurnDBImporter(com.jme3.app.SimpleApplication app)
app - The application to use for rendering.| Method Detail |
|---|
public void importModelsFromPath(java.lang.String assetPath)
assetPath - The path where the files are located.
public void importModelsFromFiles(java.lang.String assetPath,
java.util.List<java.io.File> files,
FurnDBImporter.ImportListener listener)
assetPath - The path where the files are located.files - The list of files to import.listener - The listener to notify about import process.public void setExitMode(FurnDBImporter.ExitMode exitMode)
FurnDBImporter.ExitMode for this importer. This must be done before
importing models.
exitMode - The exit mode.private void renderThumbNail(Furniture f)
f - The furniture to render a thumbnail for.
public void renderingCompleted(java.lang.String id,
java.awt.image.BufferedImage image)
RenderThumbnailState.RenderListener
renderingCompleted in interface RenderThumbnailState.RenderListenerid - The id of the rendered nodeimage - The rendered image
public void savingCompleted(java.lang.String id,
java.io.File file)
RenderThumbnailState.RenderListener
savingCompleted in interface RenderThumbnailState.RenderListenerid - The id of the rendered nodefile - The file to which the image has been savedprivate void checkForExit()
public static void main(java.lang.String[] args)
args - Args
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||